<%--
    Document   : agregarCambioGuardia
    Created on : 17/11/2010, 10:35:55 AM
    Author     : yngrdyn
--%>
<script type="text/javascript">
    $(function(){
        $('#fecha').datepicker({
            dateFormat: 'dd/mm/yy',
            maxDate: new Date(),
            showOn: "button",
            buttonImage: "style/images/calendar.gif",
            buttonText: "calendario"
        }).attr('readonly', true);
        listaSedes();
    });

</script>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file='../Templates/security.jsp' %>


<h1 class="title">Gestión de Cambios de Guardia</h1>
<hr>
<br>

<center>
    <h2>Agregar Cambios de Guardia</h2>
    <html:form action="/personalDeGuardia" styleId="agregarCambioGuardiaForm" onsubmit="return sendForm('agregarCambioGuardiaForm', 'personalDeGuardia','center');">
        <table cellspacing="5">

            <tr>
                <td>Fecha de la guardia (dd/mm/aaaa):</td>
                <td><html:text property="fechaG" styleId="fecha"/></td>
            </tr>
            <tr>
                <td>
                    <html:errors property="faltaFecha"/>
                    <html:errors property="format_Fecha"/>
                </td>
            </tr>
            <tr>
                <td>Sede:</td>
                <td>
                    <select id="Sedes" name="sede"></select>
                </td>
            </tr>
            <tr>
                <td>
                    <html:errors property="falta_Sede"/>
                </td>
            </tr>
        </table>
        <html:submit value="Buscar" styleClass="button" styleId="Prueba"/>
    </html:form>
    <br>
    <html:errors property="No_hay_Resultados"/>

    <logic:notEmpty name="agregarCambioGuardiaForm" property="personalAsist">
        <table  class="sortable">
            <tr>
                <th>C&eacute;dula</th>
                <th>Nombre</th>
                <th>Apellido</th>
            </tr>
            <% int i = 0;
                            String s = "";%>
            <logic:iterate  id="pers" name="agregarCambioGuardiaForm" property="personalAsist">

                <tr>
                    <td><bean:write name="pers" property="ci"/></td>

                    <td><bean:write name="pers" property="nombre1"/></td>

                    <td><bean:write name="pers" property="apellido1"/></td>

                    <td>
                        <form action="/agregarCambioGuardiaAux" id="agregarCambioGuardiaAuxForm1<%=i%>" onsubmit="return sendForm('agregarCambioGuardiaAuxForm1<%=i%>', 'agregarCambioGuardiaAux','center');">
                            <input type="hidden" name="ci" value="${pers.ci}"/>
                            <input type="hidden" name="fechaG" value="${agregarCambioGuardiaForm.fechaG}"/>
                            <input type="hidden" name="sede" value="${agregarCambioGuardiaForm.sede}"/>
                            <input type="submit" value="Agregar"/>
                        </form>
                    </td>

                </tr>
                <% i++;%>
            </logic:iterate>
        </table>

    </logic:notEmpty>
</center>

